1 Libraries & data

library(dplyr)
library(sjlabelled)
library(sjPlot)
library(ggplot2)
library(knitr)
library(kableExtra)
library(GPArotation)
library(lavaan)
load(file = "data/dataproc/cl09.RData")
load(file = "data/dataproc/cl99.RData")
load(file = "data/dataproc/cl19.RData")

2 Adjust data for perceived and just salaries

2.1 1999

2.1.1 Select variables

salarios99 <- cl99 %>% select(v3,
                              v21,v16,    # Salario percibio obrero y gerente
                              v31,v26)# Salario justo    obrero y gerente
dim(salarios99)
## [1] 1503    5
summary(salarios99)
##        v3          v21                   v16             
##  Min.   :30   Min.   :      10000   Min.   :     100000  
##  1st Qu.:30   1st Qu.:      90000   1st Qu.:    2000000  
##  Median :30   Median :     100000   Median :   10000000  
##  Mean   :30   Mean   :20293168113   Mean   :37995788975  
##  3rd Qu.:30   3rd Qu.:     160000   3rd Qu.:99999999998  
##  Max.   :30   Max.   :99999999999   Max.   :99999999999  
##       v31                   v26             
##  Min.   :      25000   Min.   :      80000  
##  1st Qu.:     150000   1st Qu.:    2000000  
##  Median :     200000   Median :    5000000  
##  Mean   :21357897157   Mean   :42717023815  
##  3rd Qu.:     300000   3rd Qu.:99999999998  
##  Max.   :99999999999   Max.   :99999999999
# M2_P2_PRESIDENTE cuanto gana GERENTE
# M2_P2_OBRERO cuanto gana OBRERO
# M2_P3_PRESIDENTE cuanto deberia ganar GERENTE
# M2_P3_OBRERO cuanto deberia ganar OBRERO

2.1.2 Identify missings

# table(salarios99$v21) #  99999999999
# table(salarios99$V16) #  99999999998 99999999999
# table(salarios99$V31) # 99999999998 99999999999
# table(salarios99$V26) # 99999999998 99999999999

names(salarios99)
## [1] "v3"  "v21" "v16" "v31" "v26"
salarios99[2:4][salarios99[2:4] >= 99999999998] <- NA

salarios99$v3 <- as_character(salarios99$v3)
summary(salarios99)
##       v3                 v21                 v16           
##  Length:1503        Min.   :    10000   Min.   :   100000  
##  Class :character   1st Qu.:    90000   1st Qu.:  1500000  
##  Mode  :character   Median :    90000   Median :  3000000  
##                     Mean   :   527274   Mean   :  8230504  
##                     3rd Qu.:   100000   3rd Qu.:  6250000  
##                     Max.   :120000000   Max.   :543000000  
##                     NA's   :305         NA's   :571        
##       v31                 v26             
##  Min.   :    25000   Min.   :      80000  
##  1st Qu.:   150000   1st Qu.:    2000000  
##  Median :   200000   Median :    5000000  
##  Mean   :   777858   Mean   :42717023815  
##  3rd Qu.:   200000   3rd Qu.:99999999998  
##  Max.   :300000000   Max.   :99999999999  
##  NA's   :321
dim(na.omit(salarios99))
## [1] 889   5
colSums(is.na(salarios99))
##  v3 v21 v16 v31 v26 
##   0 305 571 321   0

2.1.3 Renames

salarios99 <- rename(salarios99,pais=v3,salperger=v16,salperobr=v21,saljusger=v26,saljusobr=v31)

2.1.4 Outliers

2.1.5 Generate Gaps

#---Brecha salarial percibida
salarios99$gap_perc   <-  as.numeric(salarios99$salperger/salarios99$salperobr) # diferencia total
salarios99$lngap_perc <-  as.numeric(log(salarios99$gap_perc))                 # diferencia log

#---Brecha salarial justa
salarios99$gap_just   <-  as.numeric(salarios99$saljusger/salarios99$saljusobr) # diferencia total
salarios99$lngap_just <-  as.numeric(log(salarios99$gap_just))                # diferencia log

2.2 2009

2.2.1 Select variables

# table(salarios09$V23) # cuanto gana GERENTE
# table(salarios09$V25) # cuanto gana OBRERO
# table(salarios09$V28) # cuando deberia ganar GERENTE
# table(salarios09$V30) # cuanto deberia ganar OBRERO

salarios09 <- cl09 %>% select(v5,
                              v23,v25, # Salario percibido obrero y gerente
                              v28,v30) # Salario justo    obrero y gerente


summary(salarios09)
##        v5           v23                 v25               v28           
##  Min.   :152   Min.   :      -99   Min.   :    -99   Min.   :      -99  
##  1st Qu.:152   1st Qu.:  2000000   1st Qu.: 150000   1st Qu.:  1000000  
##  Median :152   Median :  5000000   Median : 160000   Median :  3000000  
##  Mean   :152   Mean   :  9991082   Mean   : 176822   Mean   :  5524310  
##  3rd Qu.:152   3rd Qu.: 10000000   3rd Qu.: 200000   3rd Qu.:  5000000  
##  Max.   :152   Max.   :400000000   Max.   :3000000   Max.   :400000000  
##       v30          
##  Min.   :     -99  
##  1st Qu.:  250000  
##  Median :  300000  
##  Mean   :  371163  
##  3rd Qu.:  380000  
##  Max.   :25000000
salarios09$v5 <- as_character(salarios09$v5)

2.2.2 Renames

#--- Nombres sustantivos para analisis
salarios09 <- rename(salarios09,pais=v5,salperger=v23,salperobr=v25,saljusger=v28,saljusobr=v30)

2.2.3 Outliers & NAs

salarios09 <- salarios09 %>%
  mutate(salperobr=replace(salperobr, salperobr <= 40000 | salperobr>= 1000000, NA)) %>%
  mutate(salperger=replace(salperger, salperger <= 250000 | salperger>= 100000001, NA)) %>%
  mutate(saljusobr=replace(saljusobr, saljusobr <= 40000, NA)) %>%
  mutate(saljusger=replace(saljusger, saljusger <= 100000, NA))

summary(salarios09)
##      pais             salperger           salperobr     
##  Length:1505        Min.   :   300000   Min.   : 50000  
##  Class :character   1st Qu.:  3000000   1st Qu.:150000  
##  Mode  :character   Median :  5000000   Median :160000  
##                     Mean   : 10065000   Mean   :181637  
##                     3rd Qu.: 10000000   3rd Qu.:200000  
##                     Max.   :100000000   Max.   :800000  
##                     NA's   :175         NA's   :86      
##    saljusger           saljusobr       
##  Min.   :   120000   Min.   :   80000  
##  1st Qu.:  2000000   1st Qu.:  250000  
##  Median :  3000000   Median :  300000  
##  Mean   :  6346388   Mean   :  391600  
##  3rd Qu.:  6000000   3rd Qu.:  400000  
##  Max.   :400000000   Max.   :25000000  
##  NA's   :195         NA's   :79
dim(na.omit(salarios09))
## [1] 1262    5

2.2.4 Gaps

#---Brecha salarial percibida
salarios09$gap_perc   <-  as.numeric(salarios09$salperger/salarios09$salperobr) # diferencia total
salarios09$lngap_perc <-  as.numeric(log(salarios09$gap_perc))                # diferencia log

#---Brecha salarial justa
salarios09$gap_just   <-  as.numeric(salarios09$saljusger/salarios09$saljusobr) # diferencia total
salarios09$lngap_just <-  as.numeric(log(salarios09$gap_just))                # diferencia log

2.3 2019

2.3.1 Select variables

salarios19 <- cl19 %>% select(m2_p2_presidente,m2_p2_obrero,  # Salario percibio obrero y gerente
                              m2_p3_presidente,m2_p3_obrero) # Salario justo    obrero y gerente

summary(salarios19)
##  m2_p2_presidente    m2_p2_obrero     m2_p3_presidente    m2_p3_obrero    
##  Min.   :  300000   Min.   :    100   Min.   :   50000   Min.   :    300  
##  1st Qu.: 4000000   1st Qu.: 300000   1st Qu.: 2000000   1st Qu.: 400000  
##  Median : 8000000   Median : 300000   Median : 4000000   Median : 500000  
##  Mean   :11866859   Mean   : 364542   Mean   : 6366528   Mean   : 554185  
##  3rd Qu.:15000000   3rd Qu.: 400000   3rd Qu.: 7000000   3rd Qu.: 600000  
##  Max.   :90000000   Max.   :8000000   Max.   :90000000   Max.   :4000000  
##  NA's   :339        NA's   :108       NA's   :395        NA's   :125
# NAs already identified

2.3.2 Renames

#--- Nombres sustantivos para analisis
salarios19 <- rename(salarios19,salperger=m2_p2_presidente,salperobr=m2_p2_obrero,
                     saljusger=m2_p3_presidente,saljusobr=m2_p3_obrero)

2.3.3 Outliers & NAs

2.3.4 Gaps

#---Brecha salarial percibida
salarios19$gap_perc   <-  as.numeric(salarios19$salperger/salarios19$salperobr) # diferencia total
salarios19$lngap_perc <-  as.numeric(log(salarios19$gap_perc))                  # diferencia log


#---Brecha salarial justa
salarios19$gap_just   <-  as.numeric(salarios19$saljusger/salarios19$saljusobr) # diferencia total
salarios19$lngap_just <-  as.numeric(log(salarios19$gap_just))                # diferencia log

3 Descriptive analysis

3.1 Descriptive perception

3.1.1 Perception worker

table_perob<- rbind(psych::describe(salarios99$salperobr),
               psych::describe(salarios09$salperobr),
               psych::describe(salarios19$salperobr))

rownames(table_perob) <- c("1999","2009","2019")

table_perob <- table_perob %>% select(n,mean,sd,median,trimmed,min,max)

table_perob
##         n     mean        sd median  trimmed   min       max
## 1999 1198 527273.8 6948905.2  90000  96150.0 10000 120000000
## 2009 1442 184551.7  124627.4 160000 172671.1    80   3000000
## 2019 1272 364542.3  270663.8 300000 342744.6   100   8000000

3.1.2 Perception manager

table_perger<- rbind(psych::describe(salarios99$salperger),
               psych::describe(salarios09$salperger),
               psych::describe(salarios19$salperger))

rownames(table_perger) <- c("1999","2009","2019")
table_perger <- table_perger %>% select(n,mean,sd,median,trimmed,min,max)

table_perger
##         n     mean       sd  median trimmed    min       max
## 1999  932  8230504 29300204 3000000 4157775 100000 543000000
## 2009 1343 11196273 22098413 5000000 7139535   5000 400000000
## 2019 1041 11866859 13282919 8000000 9101080 300000  90000000

3.1.3 Graph perception occupation

# Add occupation & year to tables

table_perob$ocup <-  1 # as.factor(c("Obrero"))
table_perob$year <- c(1999,2009,2019)

table_perger$ocup <- 2 # as.factor(c("Gerente"))
table_perger$year <- c(1999,2009,2019)

table_pertot <-rbind(table_perger,table_perob)
str(table_pertot)
## Classes 'psych', 'describe' and 'data.frame':    6 obs. of  9 variables:
##  $ n      : num  932 1343 1041 1198 1442 ...
##  $ mean   : num  8230504 11196273 11866859 527274 184552 ...
##  $ sd     : num  29300204 22098413 13282919 6948905 124627 ...
##  $ median : num  3000000 5000000 8000000 90000 160000 300000
##  $ trimmed: num  4157775 7139535 9101080 96150 172671 ...
##  $ min    : num  100000 5000 300000 10000 80 100
##  $ max    : num  543000000 400000000 90000000 120000000 3000000 8000000
##  $ ocup   : num  2 2 2 1 1 1
##  $ year   : num  1999 2009 2019 1999 2009 ...
table_pertot
##          n       mean         sd  median   trimmed    min       max ocup
## 1999   932  8230504.3 29300203.6 3000000 4157774.8 100000 543000000    2
## 2009  1343 11196273.3 22098413.1 5000000 7139534.9   5000 400000000    2
## 2019  1041 11866858.8 13282918.7 8000000 9101080.4 300000  90000000    2
## 19991 1198   527273.8  6948905.2   90000   96150.0  10000 120000000    1
## 20091 1442   184551.7   124627.4  160000  172671.1     80   3000000    1
## 20191 1272   364542.3   270663.8  300000  342744.6    100   8000000    1
##       year
## 1999  1999
## 2009  2009
## 2019  2019
## 19991 1999
## 20091 2009
## 20191 2019
bar1 <- ggplot(table_pertot, aes(as.factor(year),median)) +
      geom_bar(aes(fill = factor(ocup, levels=c(1,2), labels=c("Obrero", "Gerente"))), position = "dodge", stat="identity", width=.5)  +
      geom_text(aes(label=format(median, big.mark = ",", scientific = FALSE), group="Ocup"), position=position_dodge(width=0.5), vjust=-0.5) +
      theme_bw(base_size = 18) +
      scale_y_continuous(labels = scales::comma) +
      ylab('Salario (mediana)') + xlab('Años') +
      scale_fill_brewer(palette="Paired") +
      theme(legend.position="top") +
      labs(fill = " ") # quitar nombre leyenda, autoexplicativo +

bar1

# Horizontal

table_pertot$ocup2 <- factor(table_pertot$ocup, levels=c(2,1), labels=c("Gerente", "Obrero"))

salario_per <-  ggplot(data=table_pertot, aes(x=reorder(as.factor(year),-median), y=median, fill=ocup2)) +
     geom_bar(position = 'dodge', stat='identity') +
     geom_text(aes(label=format(median, big.mark = ",", scientific = FALSE), y=0), position=position_dodge(0.9), hjust=-0.25) +
     theme_bw(base_size = 12) +
     scale_y_continuous(labels = scales::comma) +
     ylab('Salario percibido (mediana)') + xlab('Años') +
     scale_fill_brewer(palette="Paired") +
     theme(legend.position="top") +
     labs(fill = " ") +
    coord_flip()

salario_per

 ggsave(salario_per,filename = "images/salario_per.png",device = "png",width = 30,height = 15,dpi = "retina",units = "cm")

3.2 Descriptive Justice

3.2.1 Worker justice

table_jusob<- rbind(psych::describe(salarios99$saljusobr),
               psych::describe(salarios09$saljusobr),
               psych::describe(salarios19$saljusobr))

rownames(table_jusob) <- c("1999","2009","2019")

table_jusob <- table_jusob %>% select(n,mean,sd,median,trimmed,min,max)

table_jusob
##         n     mean         sd median  trimmed   min       max
## 1999 1182 777857.9 10697893.6 200000 186939.8 25000 300000000
## 2009 1450 385245.7  1089703.9 300000 304887.9   190  25000000
## 2019 1255 554184.6   271174.4 500000 526263.7   300   4000000

3.2.2 Justice manager

table_jusger<- rbind(psych::describe(salarios99$saljusger),
               psych::describe(salarios09$saljusger),
               psych::describe(salarios19$saljusger))

rownames(table_jusger) <- c("1999","2009","2019")
table_jusger <- table_jusger %>% select(n,mean,sd,median,trimmed,min,max)

table_jusger
##         n    mean       sd  median trimmed   min       max
## 1999  861 4281992 21900031 2000000 2506023 80000 600000000
## 2009 1320 6298564 15027762 3000000 4096402   500 400000000
## 2019  985 6366528  9299138 4000000 4567934 50000  90000000

3.2.3 Graphic Justice

# Add occupation & year to tables

table_jusob$ocup <-  1 # as.factor(c("Obrero"))
table_jusob$year <- c(1999,2009,2019)

table_jusger$ocup <- 2 # as.factor(c("Gerente"))
table_jusger$year <- c(1999,2009,2019)

table_justot <-rbind(table_jusger,table_jusob)
str(table_justot)
## Classes 'psych', 'describe' and 'data.frame':    6 obs. of  9 variables:
##  $ n      : num  861 1320 985 1182 1450 ...
##  $ mean   : num  4281992 6298564 6366528 777858 385246 ...
##  $ sd     : num  21900031 15027762 9299138 10697894 1089704 ...
##  $ median : num  2000000 3000000 4000000 200000 300000 500000
##  $ trimmed: num  2506023 4096402 4567934 186940 304888 ...
##  $ min    : num  80000 500 50000 25000 190 300
##  $ max    : num  600000000 400000000 90000000 300000000 25000000 4000000
##  $ ocup   : num  2 2 2 1 1 1
##  $ year   : num  1999 2009 2019 1999 2009 ...
table_justot
##          n      mean         sd  median   trimmed   min       max ocup
## 1999   861 4281991.9 21900030.8 2000000 2506023.2 80000 600000000    2
## 2009  1320 6298564.0 15027762.1 3000000 4096401.5   500 400000000    2
## 2019   985 6366527.8  9299137.6 4000000 4567934.1 50000  90000000    2
## 19991 1182  777857.9 10697893.6  200000  186939.8 25000 300000000    1
## 20091 1450  385245.7  1089703.9  300000  304887.9   190  25000000    1
## 20191 1255  554184.6   271174.4  500000  526263.7   300   4000000    1
##       year
## 1999  1999
## 2009  2009
## 2019  2019
## 19991 1999
## 20091 2009
## 20191 2019
bar2 <- ggplot(table_justot, aes(as.factor(year),median)) +
      geom_bar(aes(fill = factor(ocup, levels=c(1,2), labels=c("Obrero", "Gerente"))), position = "dodge", stat="identity", width=.5)  +
      geom_text(aes(label=format(median, big.mark = ",", scientific = FALSE), group="Ocup"), position=position_dodge(width=0.5), vjust=-0.5) +
      theme_bw(base_size = 18) +
      scale_y_continuous(labels = scales::comma) +
      ylab('Salario (mediana)') + xlab('Años') +
      scale_fill_brewer(palette="Paired") +
      theme(legend.position="top") +
      labs(fill = " ") # quitar nombre leyenda, autoexplicativo +

bar2

# Horizontal

table_justot$ocup2 <- factor(table_justot$ocup, levels=c(2,1), labels=c("Gerente", "Obrero"))

salario_justo <- ggplot(data=table_justot, aes(x=reorder(as.factor(year),-median), y=median, fill=ocup2)) +
     geom_bar(position = 'dodge', stat='identity') +
     geom_text(aes(label=format(median, big.mark = ",", scientific = FALSE), y=0), position=position_dodge(0.9), hjust=-0.25) +
     theme_bw(base_size = 12) +
     scale_y_continuous(labels = scales::comma) +
     ylab('Salario justo (mediana)') + xlab('Años') +
     scale_fill_brewer(palette="Paired") +
     theme(legend.position="top") +
     labs(fill = " ") +
    coord_flip()

 ggsave(salario_justo,filename = "images/salario_justo.png",device = "png",width = 30,height = 15,dpi = "retina",units = "cm")
 
 salario_justo

3.3 Brechas salariales.

3.3.1 Brecha percivida

table_gap_perc<- rbind(psych::describe(salarios99$gap_perc),
               psych::describe(salarios09$gap_perc),
               psych::describe(salarios19$gap_perc))

rownames(table_gap_perc) <- c("1999","2009","2019")

table_gap_perc <- table_gap_perc %>% select(n,mean,sd,median,trimmed,min,max)

table_gap_perc
##         n   mean      sd median trimmed  min       max
## 1999  914  89.62  323.95  33.33   42.68 0.01   5524.86
## 2009 1337 603.63 6496.84  32.14   42.39 0.04 133333.33
## 2019 1037 279.97 3348.29  23.33   28.20 0.31  60000.00

3.3.2 Brecha justa

table_gap_just<- rbind(psych::describe(salarios99$gap_just),
               psych::describe(salarios09$gap_just),
               psych::describe(salarios19$gap_just))

rownames(table_gap_just) <- c("1999","2009","2019")

table_gap_just <- table_gap_just %>% select(n,mean,sd,median,trimmed,min,max)

table_gap_just
##         n   mean      sd median trimmed  min   max
## 1999  854  24.62  103.04   10.0   13.85 0.02  2000
## 2009 1318 192.32 2158.49   10.0   14.05 0.00 40000
## 2019  977  66.42  764.77    7.5    9.42 0.08 14000
# Add occupation & year to tables

table_gap_perc$ocup <-  1 # as.factor(c("Obrero"))
table_gap_perc$year <- c(1999,2009,2019)

table_gap_just$ocup <- 2 # as.factor(c("Gerente"))
table_gap_just$year <- c(1999,2009,2019)

table_gap_total <-rbind(table_gap_perc,table_gap_just)
str(table_gap_total)
## Classes 'psych', 'describe' and 'data.frame':    6 obs. of  9 variables:
##  $ n      : num  914 1337 1037 854 1318 ...
##  $ mean   : num  89.6 603.6 280 24.6 192.3 ...
##  $ sd     : num  324 6497 3348 103 2158 ...
##  $ median : num  33.3 32.1 23.3 10 10 ...
##  $ trimmed: num  42.7 42.4 28.2 13.9 14.1 ...
##  $ min    : num  0.0125 0.04 0.3125 0.01875 0.00167 ...
##  $ max    : num  5525 133333 60000 2000 40000 ...
##  $ ocup   : num  1 1 1 2 2 2
##  $ year   : num  1999 2009 2019 1999 2009 ...
table_gap_total
##          n   mean      sd median trimmed  min       max ocup year
## 1999   914  89.62  323.95  33.33   42.68 0.01   5524.86    1 1999
## 2009  1337 603.63 6496.84  32.14   42.39 0.04 133333.33    1 2009
## 2019  1037 279.97 3348.29  23.33   28.20 0.31  60000.00    1 2019
## 19991  854  24.62  103.04  10.00   13.85 0.02   2000.00    2 1999
## 20091 1318 192.32 2158.49  10.00   14.05 0.00  40000.00    2 2009
## 20191  977  66.42  764.77   7.50    9.42 0.08  14000.00    2 2019
bar3 <- ggplot(table_gap_total, aes(as.factor(year),median)) +
      geom_bar(aes(fill = factor(ocup, levels=c(1,2), labels=c("justa ", "percibida"))), position = "dodge", stat="identity", width=.5)  +
      geom_text(aes(label=format(median, big.mark = ",", scientific = FALSE), group="Ocup"), position=position_dodge(width=0.5), vjust=-0.5) +
      theme_bw(base_size = 18) +
      scale_y_continuous(labels = scales::comma) +
      ylab('Brecha (mediana)') + xlab('Años') +
      scale_fill_brewer(palette="Paired") +
      theme(legend.position="top") +
      labs(fill = " ") # quitar nombre leyenda, autoexplicativo +

bar3

# Horizontal

table_gap_total$ocup2 <- factor(table_gap_total$ocup, levels=c(2,1), labels=c("justa", "percibida"))

 brechas <- ggplot(data=table_gap_total, aes(x=reorder(as.factor(year),-median), y=median, fill=ocup2)) +
     geom_bar(position = 'dodge', stat='identity') +
     geom_text(aes(label=format(median, big.mark = ",", scientific = FALSE), y=0), position=position_dodge(0.9), hjust=-0.25) +
     theme_bw(base_size = 12) +
     scale_y_continuous(labels = scales::comma) +
     ylab('Brecha (mediana)') + xlab('Años') +
     scale_fill_brewer(palette="Paired") +
     theme(legend.position="top") +
     labs(fill = " ") +
    coord_flip()
 
 ggsave(brechas,filename = "images/Brechas.png",device = "png",width = 30,height = 15,dpi = "retina",units = "cm")

brechas

4 Tablas

# Tabla 1

table1<- rbind(psych::describe(salarios99$gap_perc),
               psych::describe(salarios09$gap_perc),
               psych::describe(salarios19$gap_perc))

rownames(table1) <- c("1999","2009","2019")
table1 <- table1 %>% select(n,mean,sd,median,trimmed,min,max)

kable(table1,row.names = TRUE, digits = 2,caption = "Brecha total de salario percibido por año") %>% kable_styling()
Brecha total de salario percibido por año
n mean sd median trimmed min max
1999 914 89.62 323.95 33.33 42.68 0.01 5524.86
2009 1337 603.63 6496.84 32.14 42.39 0.04 133333.33
2019 1037 279.97 3348.29 23.33 28.20 0.31 60000.00
# Tabla 2

table2<- rbind(psych::describe(salarios99$gap_just),
               psych::describe(salarios09$gap_just),
               psych::describe(salarios19$gap_just))

rownames(table2) <- c("1999","2009","2019")
table2 <- table2 %>% select(n,mean,sd,median,trimmed,min,max)

kable(table2,row.names = TRUE, digits = 2,caption = "Tabla: Brecha total de salario justo por año") %>% kable_styling()
Tabla: Brecha total de salario justo por año
n mean sd median trimmed min max
1999 854 24.62 103.04 10.0 13.85 0.02 2000
2009 1318 192.32 2158.49 10.0 14.05 0.00 40000
2019 977 66.42 764.77 7.5 9.42 0.08 14000
# # Tabla 3 ****************************************************************************************
#
# table3<- rbind(psych::describe(sal99$gap_just),
#                psych::describe(sal09$gap_just),
#                psych::describe(sal19$gap_just))
#
# rownames(table3) <- c("1999","2009","2019")
# table3 <- table3 %>% select(n,mean,sd,median,trimmed,min,max)
#
# kable(table3,row.names = TRUE, digits = 2,caption = "Tabla: Brecha total de salario justo por año") %>% kable_styling() %>%
# footnote(general = "Calculo realizado sin casos extremos superiores e inferiores \n Media recortada sin el 5% de cada extremo")

# # Tabla 4 ****************************************************************************************
#
# table4<- rbind(psych::describe(sal99$gap_perc),
#                psych::describe(sal09$gap_perc),
#                psych::describe(sal19$gap_perc))
#
# rownames(table4) <- c("1999","2009","2019")
# table4 <- table4 %>% select(n,mean,sd,median,trimmed,min,max)
#
# kable(table4,row.names = TRUE, digits = 2,caption = "Tabla: Brecha total de salario percibido por año") %>% kable_styling() %>%
# footnote(general = "Calculo realizado sin casos extremos superiores e inferiores \n Media recortada sin el 5% de cada extremo")
# ```

## Brecha estimada (log)
# Tabla 1 ****************************************************************************************
table1b<- rbind(psych::describe(log(salarios99$gap_perc)),
               psych::describe(log(salarios09$gap_perc)),
               psych::describe(log(salarios19$gap_perc)))
rownames(table1b) <- c("1999","2009","2019")
table1b <- table1b %>% select(n,mean,sd,median,trimmed,min,max)
kable(table1b,row.names = TRUE, digits = 2,caption = "Brecha total de ln(salario percibido) por año") %>% kable_styling()
Brecha total de ln(salario percibido) por año
n mean sd median trimmed min max
1999 914 3.51 1.27 3.51 3.49 -4.38 8.62
2009 1337 3.58 1.31 3.47 3.51 -3.22 11.80
2019 1037 3.17 1.18 3.15 3.12 -1.16 11.00
# Tabla 2 ****************************************************************************************
table2b<- rbind(psych::describe(log(salarios99$gap_just)),
               psych::describe(log(salarios09$gap_just)),
               psych::describe(log(salarios19$gap_just)))
rownames(table2b) <- c("1999","2009","2019")
table2b <- table2b %>% select(n,mean,sd,median,trimmed,min,max)
kable(table2b,row.names = TRUE, digits = 2,caption = "Tabla: Brecha total de ln(salario justo) por año") %>% kable_styling()
Tabla: Brecha total de ln(salario justo) por año
n mean sd median trimmed min max
1999 854 2.41 1.13 2.30 2.41 -3.98 7.60
2009 1318 2.45 1.32 2.30 2.41 -6.40 10.60
2019 977 2.04 1.21 2.01 2.00 -2.48 9.55
# Tabla 3 ****************************************************************************************

table3b<- rbind(psych::describe(log(sal99$gap_just)),
               psych::describe(log(sal09$gap_just)),
               psych::describe(log(sal19$gap_just)))

rownames(table3b) <- c("1999","2009","2019")
table3b <- table3b %>% select(n,mean,sd,median,trimmed,min,max)

kable(table3b,row.names = TRUE, digits = 2,caption = "Tabla: Brecha total de ln(salario justo) por año") %>% kable_styling() %>%
footnote(general = "Calculo realizado sin casos extremos superiores e inferiores \n Media recortada sin el 5% de cada extremo")
Tabla: Brecha total de ln(salario justo) por año
n mean sd median trimmed min max
1999 836 2.43 1.06 2.30 2.42 -1.39 7.60
2009 1283 2.40 1.08 2.30 2.39 -1.83 6.91
2019 956 2.01 1.09 2.01 2.01 -2.48 5.30
Note:
Calculo realizado sin casos extremos superiores e inferiores
Media recortada sin el 5% de cada extremo
# Tabla 4 ****************************************************************************************

table4b<- rbind(psych::describe(log(sal99$gap_perc)),
               psych::describe(log(sal09$gap_perc)),
               psych::describe(log(sal19$gap_perc)))

rownames(table4b) <- c("1999","2009","2019")
table4b <- table4b %>% select(n,mean,sd,median,trimmed,min,max)

kable(table4b,row.names = TRUE, digits = 2,caption = "Tabla: Brecha total de ln(salario percibido) por año") %>% kable_styling() %>%
footnote(general = "Calculo realizado sin casos extremos superiores e inferiores \n Media recortada sin el 5% de cada extremo")
Tabla: Brecha total de ln(salario percibido) por año
n mean sd median trimmed min max
1999 881 3.54 1.17 3.51 3.50 0.00 8.62
2009 1283 3.53 1.09 3.47 3.50 -0.59 8.11
2019 1006 3.12 1.03 3.15 3.12 -1.16 6.57
Note:
Calculo realizado sin casos extremos superiores e inferiores
Media recortada sin el 5% de cada extremo

5 Meritocracia

5.1 1999

5.1.1 Percepción

(1) Esencial - No tiene importancia (5) (8 no sabe, 9 no responde)

  • v4: Importancia para surgir: provenir familia rica (wfami)

  • V5: Importancia para surgir: Conocer personas adecuadas (knope)

(1) Muy de acuerdo - Muy en desacuerdo (5) (8 no sabe, 9 no responde)

  • v6: Recompensas: En Chile las personas son remuneradas por sus esfuerzos (refor)

  • v7: Recompensas: En Chile las personas son remuneradas por su inteligencia y capacidades (rinte)

  • v8: Hoy en día, para llegar hasta el nivel más alto en Chile, hay que ser corrupto. (corru)

merit99 <- cl99 %>% select(v4:v8,v49:v55)

merit99$V4 <- car::recode(merit99$v4,"c(8,9)=NA",as.numeric = TRUE)
merit99$v5 <- car::recode(merit99$v5,"c(8,9)=NA",as.numeric = TRUE)
merit99$v6 <- car::recode(merit99$v6,"c(8,9)=NA",as.numeric = TRUE)
merit99$v7 <- car::recode(merit99$v7,"c(8,9)=NA",as.numeric = TRUE)
merit99$v8 <- car::recode(merit99$v8,"c(8,9)=NA",as.numeric = TRUE)

merit99$v4 <- sjmisc::rec(merit99$v4,rec="rev")
merit99$v5 <- sjmisc::rec(merit99$v5,rec="rev")
merit99$v6 <- sjmisc::rec(merit99$v6,rec="rev")
merit99$v7 <- sjmisc::rec(merit99$v7,rec="rev")
merit99$v8 <- sjmisc::rec(merit99$v8,rec="rev")


merit99 <- rename(merit99,
                  wfami = v4,
                  knope = v5,
                  refor = v6,
                  rinte = v7,
                  corru = v8)

poly99a <- psych::polychoric(select(merit99,c(wfami,knope,refor,rinte,corru)),na.rm = TRUE)
corrplot::corrplot.mixed(poly99a$rho,order = "AOE")
**Correlación Policórica para Batería de _Percepción_ de Meritocracia para Chile ISSP 1999**

Correlación Policórica para Batería de Percepción de Meritocracia para Chile ISSP 1999

library(GPArotation)
sjPlot::sjt.fa(select(merit99,c(wfami,knope,refor,rinte)),
               method = "wls",
               nmbr.fctr = 2,
               title="Analisis Factorial 1999 Percepcion")
Analisis Factorial 1999 Percepcion
  Factor 1 Factor 2
Importance: coming from a wealthy famil 0.08 0.55
Importance: Knowing the right people -0.09 0.67
People get rewarded for their effort 0.77 -0.02
People get rewarded for their skills 0.84 0.01
Cronbach’s α 0.79 0.45
m1per99 <- '
gah_nmerit=~wfami+knope+corru
recom=~refor+rinte
'
fit1 <- cfa(model = m1per99,data = merit99)
semPlot::semPaths(fit1, "std",
                  edge.color = "black",
                  style = "ram",
                  exoVar = TRUE,
                  intercepts = F,
                  thresholds = F,
                  fade =F)

5.1.2 Preferencia

(1) Esencial - No tiene importancia (5) (8 no sabe, 9 no responde) OO - v49:Importancia para pagar: nivel de responsabilidadad asociado al trabajo (respo)

  • v50:Importancia para pagar: numero de años dedicados a educación y capacitación (neduc)

  • v51:Importancia para pagar: si el trabajo requiere que se supervise a otras personas (suprv)

  • v52:Importancia para pagar: Lo que se necesita para mantener a una familia (mafam)

  • v53:Importancia para pagar: Que una persona tenga hijos que mantener (hchil)

  • v54:Importancia para pagar: Lo bien que él/ella realiza su trabajo (gdwrk)

  • v55:Importancia para pagar: Cuánto se esfuerza él ella en realizar su trabajo (effor)

merit99$v49 <- car::recode(merit99$v49,"c(8,9)=NA",as.numeric = TRUE)
merit99$v50 <- car::recode(merit99$v50,"c(8,9)=NA",as.numeric = TRUE)
merit99$v51 <- car::recode(merit99$v51,"c(8,9)=NA",as.numeric = TRUE)
merit99$v52 <- car::recode(merit99$v52,"c(8,9)=NA",as.numeric = TRUE)
merit99$v53 <- car::recode(merit99$v53,"c(8,9)=NA",as.numeric = TRUE)
merit99$v54 <- car::recode(merit99$v54,"c(8,9)=NA",as.numeric = TRUE)
merit99$v55 <- car::recode(merit99$v55,"c(8,9)=NA",as.numeric = TRUE)

merit99$v49 <-sjmisc::rec(merit99$v49,rec="rev")
merit99$v50 <-sjmisc::rec(merit99$v50,rec="rev")
merit99$v51 <-sjmisc::rec(merit99$v51,rec="rev")
merit99$v52 <-sjmisc::rec(merit99$v52,rec="rev")
merit99$v53 <-sjmisc::rec(merit99$v53,rec="rev")
merit99$v54 <-sjmisc::rec(merit99$v54,rec="rev")
merit99$v55 <-sjmisc::rec(merit99$v55,rec="rev")


merit99 <- rename(merit99,
                  respo=v49,
                  neduc=v50,
                  suprv=v51,
                  mafam=v52,
                  hchil=v53,
                  gdwrk=v54,
                  effor=v55)


poly99b<- psych::polychoric(select(merit99,c(respo,neduc,suprv,mafam,hchil,gdwrk,effor)),na.rm = TRUE)
corrplot::corrplot.mixed(poly99b$rho,order = "AOE")
**Correlación Policórica para Batería de _Preferencias_ en Meritocracia para Chile ISSP 1999**

Correlación Policórica para Batería de Preferencias en Meritocracia para Chile ISSP 1999

library(GPArotation)
sjPlot::sjt.fa(select(merit99,c(respo,neduc,suprv,mafam,hchil,gdwrk,effor)),
               method = "wls",
               nmbr.fctr = 3,
               title="Analisis Factorial 1999 Preferencia")
Analisis Factorial 1999 Preferencia
  Factor 1 Factor 2 Factor 3
Importance to pay: responsibility -0.03 0.08 0.54
Importance to pay: education & training 0.02 -0.13 0.67
Importance to pay: supervising others -0.00 0.12 0.45
Importance to pay: supporting a family 0.59 0.04 0.11
Importance to pay: having children 0.90 -0.04 -0.09
Importance to pay: how well they do it -0.10 0.84 0.00
Importance to pay: how hard they work 0.14 0.61 -0.02
Cronbach’s α 0.70 0.68 0.57
m1pref99 <- '
resp=~respo+neduc+suprv
fami=~mafam+hchil
merit=~gdwrk+effor
'
fit2 <- cfa(model = m1pref99,data = merit99, ordered = c("respo","neduc","suprv","mafam","hchil","gdwrk","effor"))
summary(fit2, fit.measures=TRUE, standardized=TRUE)
## lavaan 0.6-3 ended normally after 24 iterations
## 
##   Optimization method                           NLMINB
##   Number of free parameters                         38
## 
##                                                   Used       Total
##   Number of observations                          1412        1503
## 
##   Estimator                                       DWLS      Robust
##   Model Fit Test Statistic                      41.286      79.425
##   Degrees of freedom                                11          11
##   P-value (Chi-square)                           0.000       0.000
##   Scaling correction factor                                  0.525
##   Shift parameter                                            0.729
##     for simple second-order correction (Mplus variant)
## 
## Model test baseline model:
## 
##   Minimum Function Test Statistic             7506.930    4915.746
##   Degrees of freedom                                21          21
##   P-value                                        0.000       0.000
## 
## User model versus baseline model:
## 
##   Comparative Fit Index (CFI)                    0.996       0.986
##   Tucker-Lewis Index (TLI)                       0.992       0.973
## 
##   Robust Comparative Fit Index (CFI)                            NA
##   Robust Tucker-Lewis Index (TLI)                               NA
## 
## Root Mean Square Error of Approximation:
## 
##   RMSEA                                          0.044       0.066
##   90 Percent Confidence Interval          0.030  0.059       0.053  0.080
##   P-value RMSEA <= 0.05                          0.725       0.022
## 
##   Robust RMSEA                                                  NA
##   90 Percent Confidence Interval                                NA     NA
## 
## Standardized Root Mean Square Residual:
## 
##   SRMR                                           0.027       0.027
## 
## Parameter Estimates:
## 
##   Information                                 Expected
##   Information saturated (h1) model        Unstructured
##   Standard Errors                           Robust.sem
## 
## Latent Variables:
##                    Estimate  Std.Err  z-value  P(>|z|)   Std.lv  Std.all
##   resp =~                                                               
##     respo             1.000                               0.654    0.654
##     neduc             0.928    0.047   19.930    0.000    0.607    0.607
##     suprv             0.988    0.048   20.717    0.000    0.646    0.646
##   fami =~                                                               
##     mafam             1.000                               0.822    0.822
##     hchil             0.884    0.039   22.624    0.000    0.727    0.727
##   merit =~                                                              
##     gdwrk             1.000                               0.770    0.770
##     effor             1.030    0.031   33.618    0.000    0.793    0.793
## 
## Covariances:
##                    Estimate  Std.Err  z-value  P(>|z|)   Std.lv  Std.all
##   resp ~~                                                               
##     fami              0.286    0.019   14.826    0.000    0.533    0.533
##     merit             0.357    0.020   18.137    0.000    0.709    0.709
##   fami ~~                                                               
##     merit             0.406    0.020   20.635    0.000    0.642    0.642
## 
## Intercepts:
##                    Estimate  Std.Err  z-value  P(>|z|)   Std.lv  Std.all
##    .respo             0.000                               0.000    0.000
##    .neduc             0.000                               0.000    0.000
##    .suprv             0.000                               0.000    0.000
##    .mafam             0.000                               0.000    0.000
##    .hchil             0.000                               0.000    0.000
##    .gdwrk             0.000                               0.000    0.000
##    .effor             0.000                               0.000    0.000
##     resp              0.000                               0.000    0.000
##     fami              0.000                               0.000    0.000
##     merit             0.000                               0.000    0.000
## 
## Thresholds:
##                    Estimate  Std.Err  z-value  P(>|z|)   Std.lv  Std.all
##     respo|t1         -2.859    0.183  -15.622    0.000   -2.859   -2.859
##     respo|t2         -2.155    0.084  -25.574    0.000   -2.155   -2.155
##     respo|t3         -1.018    0.040  -25.147    0.000   -1.018   -1.018
##     respo|t4          0.635    0.036   17.671    0.000    0.635    0.635
##     neduc|t1         -2.693    0.149  -18.086    0.000   -2.693   -2.693
##     neduc|t2         -1.807    0.063  -28.646    0.000   -1.807   -1.807
##     neduc|t3         -0.902    0.039  -23.255    0.000   -0.902   -0.902
##     neduc|t4          0.697    0.036   19.103    0.000    0.697    0.697
##     suprv|t1         -2.279    0.095  -24.036    0.000   -2.279   -2.279
##     suprv|t2         -1.429    0.049  -29.022    0.000   -1.429   -1.429
##     suprv|t3         -0.637    0.036  -17.723    0.000   -0.637   -0.637
##     suprv|t4          0.889    0.039   23.016    0.000    0.889    0.889
##     mafam|t1         -2.357    0.103  -22.987    0.000   -2.357   -2.357
##     mafam|t2         -1.609    0.055  -29.285    0.000   -1.609   -1.609
##     mafam|t3         -0.711    0.037  -19.407    0.000   -0.711   -0.711
##     mafam|t4          0.672    0.036   18.542    0.000    0.672    0.672
##     hchil|t1         -2.029    0.075  -26.930    0.000   -2.029   -2.029
##     hchil|t2         -1.368    0.048  -28.736    0.000   -1.368   -1.368
##     hchil|t3         -0.575    0.035  -16.225    0.000   -0.575   -0.575
##     hchil|t4          0.828    0.038   21.853    0.000    0.828    0.828
##     gdwrk|t1         -2.985    0.216  -13.808    0.000   -2.985   -2.985
##     gdwrk|t2         -1.989    0.073  -27.308    0.000   -1.989   -1.989
##     gdwrk|t3         -0.757    0.037  -20.415    0.000   -0.757   -0.757
##     gdwrk|t4          0.795    0.038   21.212    0.000    0.795    0.795
##     effor|t1         -2.387    0.106  -22.576    0.000   -2.387   -2.387
##     effor|t2         -1.345    0.047  -28.607    0.000   -1.345   -1.345
##     effor|t3         -0.448    0.035  -12.935    0.000   -0.448   -0.448
##     effor|t4          0.916    0.039   23.492    0.000    0.916    0.916
## 
## Variances:
##                    Estimate  Std.Err  z-value  P(>|z|)   Std.lv  Std.all
##    .respo             0.573                               0.573    0.573
##    .neduc             0.632                               0.632    0.632
##    .suprv             0.583                               0.583    0.583
##    .mafam             0.324                               0.324    0.324
##    .hchil             0.472                               0.472    0.472
##    .gdwrk             0.407                               0.407    0.407
##    .effor             0.371                               0.371    0.371
##     resp              0.427    0.029   14.684    0.000    1.000    1.000
##     fami              0.676    0.031   21.940    0.000    1.000    1.000
##     merit             0.593    0.023   25.248    0.000    1.000    1.000
## 
## Scales y*:
##                    Estimate  Std.Err  z-value  P(>|z|)   Std.lv  Std.all
##     respo             1.000                               1.000    1.000
##     neduc             1.000                               1.000    1.000
##     suprv             1.000                               1.000    1.000
##     mafam             1.000                               1.000    1.000
##     hchil             1.000                               1.000    1.000
##     gdwrk             1.000                               1.000    1.000
##     effor             1.000                               1.000    1.000

5.2 2009

5.2.1 Percepción

(1) Esencial - No tiene importancia (5) (8 no sabe, 9 no responde)

  • V6 : Importancia para surgir: provenir de familia rica (wfami)

  • V7 : Importancia para surgir: tener padres con buen nivel de educación (edpar)

  • V8 : Importancia para surgir: que UD tenga un buen nivel de educación (slfed)

  • V9 : Importancia para surgir: Tener ambición (ambit)

  • V10: Importancia para surgir: trabajo duro (hwork)

  • V11: Importancia para surgir: conocer a las personas adecuadas (knope)

  • V12: Importancia para surgir: tener contactos políticos (polco)

  • V13: Importancia para surgir: pagar coimas (corru)

  • V14: Importancia para surgir: la raza u origen étnico de las personas (etnic)

  • V15: Importancia para surgir: la religión que tengan las personas (relig)

  • V16: Importancia para surgir: el sexo de las personas, ser hombre o mujer (gendr)

merit09 <- cl09 %>% select(v6:v16,v47:v52)

merit09$v6  <- car::recode(merit09$v6 ,"c(8,9)=NA",as.numeric = TRUE) # Recodificación missing
merit09$v7  <- car::recode(merit09$v7 ,"c(8,9)=NA",as.numeric = TRUE)
merit09$v8  <- car::recode(merit09$v8 ,"c(8,9)=NA",as.numeric = TRUE)
merit09$v9  <- car::recode(merit09$v9 ,"c(8,9)=NA",as.numeric = TRUE)
merit09$v10 <- car::recode(merit09$v10,"c(8,9)=NA",as.numeric = TRUE)
merit09$v11 <- car::recode(merit09$v11,"c(8,9)=NA",as.numeric = TRUE)
merit09$v12 <- car::recode(merit09$v12,"c(8,9)=NA",as.numeric = TRUE)
merit09$v13 <- car::recode(merit09$v13,"c(8,9)=NA",as.numeric = TRUE)
merit09$v14 <- car::recode(merit09$v14,"c(8,9)=NA",as.numeric = TRUE)
merit09$v15 <- car::recode(merit09$v15,"c(8,9)=NA",as.numeric = TRUE)
merit09$v16 <- car::recode(merit09$v16,"c(8,9)=NA",as.numeric = TRUE)

merit09$v6  <-sjmisc::rec(merit09$v6 ,rec="rev")# invertir sentido escala
merit09$v7  <-sjmisc::rec(merit09$v7 ,rec="rev")# invertir sentido escala
merit09$v8  <-sjmisc::rec(merit09$v8 ,rec="rev")# invertir sentido escala
merit09$v9  <-sjmisc::rec(merit09$v9 ,rec="rev")# invertir sentido escala
merit09$v10 <-sjmisc::rec(merit09$v10,rec="rev")# invertir sentido escala
merit09$v11 <-sjmisc::rec(merit09$v11,rec="rev")# invertir sentido escala
merit09$v12 <-sjmisc::rec(merit09$v12,rec="rev")# invertir sentido escala
merit09$v13 <-sjmisc::rec(merit09$v13,rec="rev")# invertir sentido escala
merit09$v14 <-sjmisc::rec(merit09$v14,rec="rev")# invertir sentido escala
merit09$v15 <-sjmisc::rec(merit09$v15,rec="rev")# invertir sentido escala
merit09$v16 <-sjmisc::rec(merit09$v16,rec="rev")# invertir sentido escala

merit09<- rename(merit09,
                 wfami=v6 ,
                 edpar=v7 ,
                 slfed=v8 ,
                 ambit=v9 ,
                 hwork=v10,
                 knope=v11,
                 polco=v12,
                 corru=v13,
                 etnic=v14,
                 relig=v15,
                 gendr=v16)


poly09a <- psych::polychoric(select(merit09,c(wfami,edpar,slfed,ambit,hwork,knope,polco,corru,etnic,relig,gendr)),na.rm = TRUE)
corrplot::corrplot.mixed(poly09a$rho,order = "AOE")
**Correlación Policórica para Batería de _Percepción_ en Meritocracia para Chile ISSP 2009**

Correlación Policórica para Batería de Percepción en Meritocracia para Chile ISSP 2009

library(GPArotation)
sjPlot::sjt.fa(select(merit09,c(wfami,edpar,slfed,ambit,hwork,polco,corru,etnic,relig,gendr)),
               method = "wls",
               nmbr.fctr = 4,
               title = "Analisis Factorial 2009 Percepcion")
Analisis Factorial 2009 Percepcion
  Factor 1 Factor 2 Factor 3 Factor 4
Q1a Getting ahead: How important is
coming from a wealthy family?
-0.01 0.58 0.23 -0.07
Q1b Getting ahead: How important is
having well-educated parents?
0.04 0.82 -0.08 -0.03
Q1c Getting ahead: How important is
having a good education yourself?
-0.01 0.21 -0.09 0.33
Q1d Getting ahead: How Important is
having ambition?
-0.03 -0.07 0.18 0.62
Q1e Getting ahead: How important is hard
work?
0.02 -0.11 -0.05 0.57
Q1g Getting ahead: How important is
having political connections?
-0.07 0.06 0.73 -0.00
Q1h Getting ahead: How important is
giving bribes?
0.32 -0.04 0.44 0.08
Q1i Getting ahead: How important is a
person’s race?
0.66 0.08 0.11 -0.04
Q1j Getting ahead: How important is a
person’s religion?
0.91 -0.06 -0.11 -0.04
Q1k Getting ahead: How important is
being born a man or a woman?
0.79 0.05 -0.04 0.05
Cronbach’s α 0.82 0.67 0.60 0.49

5.2.2 Preferencia

  • V47:Importancia para pagar: el nivel de responsabilidad que tiene el trabajo (respo)

  • V48:Importancia para pagar: el numero de años dedicados a la educación y capacitación (neduc)

  • V49:Importancia para pagar: lo que se necesita para mantener una familia (mafam)

  • V50:Importancia para pagar: El que la persona tenga hijos que mantener (hchil)

  • V51:Importancia para pagar: lo bien que él o ella realiza su tabajo (gdwrk)

  • V52:Importancia para pagar: Lo que él o ella se esfuerza al realizar su trabajo (effor)

merit09$v47  <- car::recode(merit09$v47,"c(8,9)=NA",as.numeric = TRUE) # Recodificación missing
merit09$v48  <- car::recode(merit09$v48,"c(8,9)=NA",as.numeric = TRUE)
merit09$v49  <- car::recode(merit09$v49,"c(8,9)=NA",as.numeric = TRUE)
merit09$v50  <- car::recode(merit09$v50,"c(8,9)=NA",as.numeric = TRUE)
merit09$v51  <- car::recode(merit09$v51,"c(8,9)=NA",as.numeric = TRUE)
merit09$v52  <- car::recode(merit09$v52,"c(8,9)=NA",as.numeric = TRUE)


merit09$v47  <-sjmisc::rec(merit09$v47 ,rec="rev")# invertir sentido escala
merit09$v48  <-sjmisc::rec(merit09$v48 ,rec="rev")# invertir sentido escala
merit09$v49  <-sjmisc::rec(merit09$v49 ,rec="rev")# invertir sentido escala
merit09$v50  <-sjmisc::rec(merit09$v50 ,rec="rev")# invertir sentido escala
merit09$v51  <-sjmisc::rec(merit09$v51 ,rec="rev")# invertir sentido escala
merit09$v52  <-sjmisc::rec(merit09$v52 ,rec="rev")# invertir sentido escala

merit09<- rename(merit09,
                 respo=v47,
                 neduc=v48,
                 mafam=v49,
                 hchil=v50,
                 gdwrk=v51,
                 effor=v52)


poly09b <- psych::polychoric(select(merit09,c(respo,neduc,mafam,hchil,gdwrk,effor)),na.rm = TRUE)
corrplot::corrplot.mixed(poly09b$rho,order = "AOE")
**Correlación Policórica para Batería de _Preferencias_ en Meritocracia para Chile ISSP 2009**

Correlación Policórica para Batería de Preferencias en Meritocracia para Chile ISSP 2009

library(GPArotation)
sjPlot::sjt.fa(select(merit09,c(respo,neduc,mafam,hchil,gdwrk,effor)),
               method = "wls",
               nmbr.fctr = 2,
               title = "Analisis Factorial 2009 Preferencia")
Analisis Factorial 2009 Preferencia
  Factor 1 Factor 2
Q12a Important for pay: How much
responsibility goes with the job?
0.48 0.04
Q12b Important for pay: the number of
years spent in education and training?
0.35 0.10
Q12c Important for pay: what is needed
to support a family?
-0.10 0.99
Q12d Important for pay: whether the
person has children to support?
0.06 0.66
Q12e Important for pay: how well he or
she does the job?
0.93 -0.17
Q12f Important for pay: How hard he or
she works at the job?
0.76 0.00
Cronbach’s α 0.71 0.79

5.3 2019

5.3.1 Percepción

(1) Esencial - No tiene importancia (5) (8 no sabe, 9 no responde)

  • M2_P1_1 : Para surgir en la vida: Tener ambición

  • M2_P1_2 : Para surgir en la vida: Provenir de una familia rica

  • M2_P1_3 : Para surgir en la vida: Tener padres con buen nivel de educación

  • M2_P1_4 : Para surgir en la vida: Que UD tenga un buen nivel de educación

  • M2_P1_5 : Para surgir en la vida: El Trabajo Duro

  • M2_P1_6 : Para surgir en la vida: Conocer a la personas adecuadas

  • M2_P1_7 : Para surgir en la vida: Tener contactos políticos

  • M2_P1_8 : Para surgir en la vida: Pagar coimas

  • M2_P1_9 : Para surgir en la vida: La raza u origen étnico de la persona

  • M2_P1_10: Para surgir en la vida: la religión de las personas

  • M2_P1_11: Para surgir en la vida: el sexo de las personas

merit19 <- cl19 %>% select(m2_p1_1:m2_p1_11,m2_p14_1:m2_p14_4)

merit19$m2_p1_1  <- car::recode(merit19$m2_p1_1  ,"c(8,9)=NA",as.numeric = TRUE) # Recodificación missing
merit19$m2_p1_2  <- car::recode(merit19$m2_p1_2  ,"c(8,9)=NA",as.numeric = TRUE)
merit19$m2_p1_3  <- car::recode(merit19$m2_p1_3  ,"c(8,9)=NA",as.numeric = TRUE)
merit19$m2_p1_4  <- car::recode(merit19$m2_p1_4  ,"c(8,9)=NA",as.numeric = TRUE)
merit19$m2_p1_5  <- car::recode(merit19$m2_p1_5  ,"c(8,9)=NA",as.numeric = TRUE)
merit19$m2_p1_6  <- car::recode(merit19$m2_p1_6  ,"c(8,9)=NA",as.numeric = TRUE)
merit19$m2_p1_7  <- car::recode(merit19$m2_p1_7  ,"c(8,9)=NA",as.numeric = TRUE)
merit19$m2_p1_8  <- car::recode(merit19$m2_p1_8  ,"c(8,9)=NA",as.numeric = TRUE)
merit19$m2_p1_9  <- car::recode(merit19$m2_p1_9  ,"c(8,9)=NA",as.numeric = TRUE)
merit19$m2_p1_10 <- car::recode(merit19$m2_p1_10 ,"c(8,9)=NA",as.numeric = TRUE)
merit19$m2_p1_11 <- car::recode(merit19$m2_p1_11 ,"c(8,9)=NA",as.numeric = TRUE)

merit19$m2_p1_1  <-sjmisc::rec(merit19$m2_p1_1 ,rec="rev")# invertir sentido escala
merit19$m2_p1_2  <-sjmisc::rec(merit19$m2_p1_2 ,rec="rev")# invertir sentido escala
merit19$m2_p1_3  <-sjmisc::rec(merit19$m2_p1_3 ,rec="rev")# invertir sentido escala
merit19$m2_p1_4  <-sjmisc::rec(merit19$m2_p1_4 ,rec="rev")# invertir sentido escala
merit19$m2_p1_5  <-sjmisc::rec(merit19$m2_p1_5 ,rec="rev")# invertir sentido escala
merit19$m2_p1_6  <-sjmisc::rec(merit19$m2_p1_6 ,rec="rev")# invertir sentido escala
merit19$m2_p1_7  <-sjmisc::rec(merit19$m2_p1_7 ,rec="rev")# invertir sentido escala
merit19$m2_p1_8  <-sjmisc::rec(merit19$m2_p1_8 ,rec="rev")# invertir sentido escala
merit19$m2_p1_9  <-sjmisc::rec(merit19$m2_p1_9 ,rec="rev")# invertir sentido escala
merit19$m2_p1_10 <-sjmisc::rec(merit19$m2_p1_10,rec="rev")# invertir sentido escala
merit19$m2_p1_11 <-sjmisc::rec(merit19$m2_p1_11,rec="rev")# invertir sentido escala

merit19<- rename(merit19,
                 ambit=m2_p1_1 ,
                 wfami=m2_p1_2 ,
                 edpar=m2_p1_3 ,
                 slfed=m2_p1_4 ,
                 hwork=m2_p1_5 ,
                 knope=m2_p1_6 ,
                 polco=m2_p1_7 ,
                 corru=m2_p1_8 ,
                 etnic=m2_p1_9 ,
                 relig=m2_p1_10,
                 gendr=m2_p1_11 )


poly19a <- psych::polychoric(select(merit19,c(wfami,edpar,slfed,ambit,hwork,knope,polco,corru,etnic,relig,gendr)),na.rm = TRUE)
corrplot::corrplot.mixed(poly19a$rho,order = "AOE")
**Correlación Policórica para Batería de _Percepción_ en Meritocracia para Chile ISSP 2019**

Correlación Policórica para Batería de Percepción en Meritocracia para Chile ISSP 2019

sjPlot::sjt.fa(select(merit19,c(wfami,edpar,slfed,hwork,polco,corru,etnic,relig,gendr)),
               method = "wls",
               nmbr.fctr = 4,
               title = "Analisis Factorial 2019 Percepción")
Analisis Factorial 2019 Percepción
  Factor 1 Factor 2 Factor 3 Factor 4
Para surgir en la vida, ¿cuán importante
cree Ud. que es "Provenir de una famili
-0.09 0.74 0.01 -0.02
Para surgir en la vida, ¿cuán importante
cree Ud. que es "Tener padres con altos
-0.06 0.56 0.02 0.16
Para surgir en la vida, ¿cuán importante
cree Ud. que es "Que Ud. tenga un buen
0.07 0.11 -0.02 0.87
Para surgir en la vida, ¿cuán importante
cree Ud. que es “El trabajo duro”?
0.02 0.02 0.94 -0.02
Para surgir en la vida, ¿cuán importante
cree Ud. que es "Tener contactos políti
0.27 0.45 -0.03 -0.04
Para surgir en la vida, ¿cuán importante
cree Ud. que es “Pagar coimas”?
0.43 0.32 -0.00 -0.17
Para surgir en la vida, ¿cuán importante
cree Ud. que es "La raza u origen étnic
0.82 -0.00 -0.01 -0.00
Para surgir en la vida, ¿cuán importante
cree Ud. que es "La religión de las per
0.88 -0.10 0.01 0.08
Para surgir en la vida, ¿cuán importante
cree Ud. que es "El sexo de las persona
0.93 -0.13 0.02 0.08
Cronbach’s α 0.85 0.61

5.3.2 Preferencia

  • M2_P14_1: Importancia para ganar: El nivel de responsabilidad que tiene su trabajo

  • M2_P14_2: Importancia para ganar: El número de años dedicados a educación y capacitación

  • M2_P14_3: Importancia para ganar: El que la persona tenga hijos que mantener

  • M2_P14_4: Importancia para ganar: Lo bien que él o ella realiza su trabajo

merit19$m2_p14_1  <- car::recode(merit19$m2_p14_1,"c(8,9)=NA",as.numeric = TRUE) # Recodificación missing
merit19$m2_p14_2  <- car::recode(merit19$m2_p14_2,"c(8,9)=NA",as.numeric = TRUE)
merit19$m2_p14_3  <- car::recode(merit19$m2_p14_3,"c(8,9)=NA",as.numeric = TRUE)
merit19$m2_p14_4  <- car::recode(merit19$m2_p14_4,"c(8,9)=NA",as.numeric = TRUE)



merit19$m2_p14_1  <-sjmisc::rec(merit19$m2_p14_1 ,rec="rev")# invertir sentido escala
merit19$m2_p14_2  <-sjmisc::rec(merit19$m2_p14_2 ,rec="rev")# invertir sentido escala
merit19$m2_p14_3  <-sjmisc::rec(merit19$m2_p14_3 ,rec="rev")# invertir sentido escala
merit19$m2_p14_4  <-sjmisc::rec(merit19$m2_p14_4 ,rec="rev")# invertir sentido escala

merit19<- rename(merit19,
                respo=m2_p14_1,
                neduc=m2_p14_2,
                hchil=m2_p14_3,
                gdwrk=m2_p14_4)


poly19b <- psych::polychoric(select(merit19,c(respo,neduc,hchil,gdwrk)),na.rm = TRUE)
corrplot::corrplot.mixed(poly19b$rho,order = "AOE")
**Correlación Policórica para Batería de _Preferencias_ en Meritocracia para Chile ISSP 2019**

Correlación Policórica para Batería de Preferencias en Meritocracia para Chile ISSP 2019

6 Subjective Social Status and Salary Gaps

load(file = "data/dataproc/issp9919.RData")
labess <-  c("Más bajo",2,3,4,5,6,7,8,9,"Más alto")

6.1 Subjective status and percieved salary gap

plot01a<- ggplot(data=subset(clw3,year==1999), aes(ess, y=lngap_perc)) +
  geom_point() +
  scale_x_discrete(limits=levels(factor(clw3$ess)),labels=labess) +
  geom_jitter(width = 0.9, height = 0.9) + 
  geom_smooth(method='lm') +
  xlab(label = "Estatus Social Subjetivo")+
  ylab(label = "Becha salarial percibida")+
   labs(title = "Brecha salarial percibida según Estatus Social Subjetivo",
       subtitle = "1999",
       caption = "Fuente: Elaboración propia a partir de datos ISSP") +
  theme_classic(base_size = 17) +
      theme(axis.text=element_text(size=10,face = "plain"),
         axis.title.y = element_text(size=10, face="bold"),
         axis.title.x = element_text(size=10, face="bold"),
         plot.title=element_text(hjust=0.5,size = 12,face = "bold"),
         plot.subtitle=element_text(hjust=0.5,size = 10,face = "bold"),
         plot.caption = element_text(hjust=1,size = 10,face = "plain"),
         panel.grid = element_blank(),
         panel.border = element_blank())
plot01a

ggsave(plot01a,filename = "images/ess_lnperc99.png",device = "png",width = 30,height = 15,dpi = "retina",units = "cm")


plot01b<-ggplot(data=subset(clw3,year==2009), aes(ess, y=lngap_perc)) +
  geom_point() +
  scale_x_discrete(limits=levels(factor(clw3$ess)),labels=labess) +
  geom_jitter(width = 0.9, height = 0.9) + 
  geom_smooth(method='lm')  +
  xlab(label = "Estatus Social Subjetivo")+
  ylab(label = "Becha salarial percibida")+
   labs(title = "Brecha salarial percibida según Estatus Social Subjetivo",
       subtitle = "2009",
       caption = "Fuente: Elaboración propia a partir de datos ISSP") +
  theme_classic(base_size = 17) +
      theme(axis.text=element_text(size=10,face = "plain"),
         axis.title.y = element_text(size=10, face="bold"),
         axis.title.x = element_text(size=10, face="bold"),
         plot.title=element_text(hjust=0.5,size = 12,face = "bold"),
         plot.subtitle=element_text(hjust=0.5,size = 10,face = "bold"),
         plot.caption = element_text(hjust=1,size = 10,face = "plain"),
         panel.grid = element_blank(),
         panel.border = element_blank())
plot01b

ggsave(plot01b,filename = "images/ess_lnperc09.png",device = "png",width = 30,height = 15,dpi = "retina",units = "cm")

plot01c<-ggplot(data=subset(clw3,year==2019), aes(ess, y=lngap_perc)) +
  geom_point() +
  scale_x_discrete(limits=levels(factor(clw3$ess)),labels=labess) +
  geom_jitter(width = 0.9, height = 0.9) + 
  geom_smooth(method='lm')  +
  xlab(label = "Estatus Social Subjetivo")+
  ylab(label = "Becha salarial percibida")+
   labs(title = "Brecha salarial percibida según Estatus Social Subjetivo",
       subtitle = "2019",
       caption = "Fuente: Elaboración propia a partir de datos CEP") +
  theme_classic(base_size = 17) +
      theme(axis.text=element_text(size=10,face = "plain"),
         axis.title.y = element_text(size=10, face="bold"),
         axis.title.x = element_text(size=10, face="bold"),
         plot.title=element_text(hjust=0.5,size = 12,face = "bold"),
         plot.subtitle=element_text(hjust=0.5,size = 10,face = "bold"),
         plot.caption = element_text(hjust=1,size = 10,face = "plain"),
         panel.grid = element_blank(),
         panel.border = element_blank())
plot01c

ggsave(plot01c,filename = "images/ess_lnperc19.png",device = "png",width = 30,height = 15,dpi = "retina",units = "cm")
plot01d<-ggplot(data=clw3, aes(ess, y=lngap_perc)) +
  geom_point() +
  scale_x_discrete(limits=levels(factor(clw3$ess)),labels=labess) +
  geom_jitter(width = 0.9, height = 0.9) + 
  geom_smooth(method='lm') +
  xlab(label = "Estatus Social Subjetivo")+
  ylab(label = "Becha salarial percibida")+
   labs(title = "Brecha salarial percibida según Estatus Social Subjetivo",
       subtitle = "1999 - 2019",
       caption = "Fuente: Elaboración propia a partir de datos CEP-ISSP") +
  theme_classic(base_size = 17) +
   theme(axis.text=element_text(size=10,face = "plain"),
         axis.title.y = element_text(size=10, face="bold"),
         axis.title.x = element_text(size=10, face="bold"),
         plot.title=element_text(hjust=0.5,size = 12,face = "bold"),
         plot.subtitle=element_text(hjust=0.5,size = 10,face = "bold"),
         plot.caption = element_text(hjust=1,size = 10,face = "plain"),
         panel.grid = element_blank(),
         panel.border = element_blank())
plot01d

ggsave(plot01d,filename = "images/ess_lnperc99_19.png",device = "png",width = 30,height = 15,dpi = "retina",units = "cm")

6.2 Subjective status and just salary gap

plot02a <- ggplot(data=subset(clw3,year==1999), aes(ess, y=lngap_just)) +
  geom_point() +
  scale_x_discrete(limits=levels(factor(clw3$ess)),labels=labess) +
  geom_jitter(width = 0.9, height = 0.9) + 
  geom_smooth(method='lm') +
  xlab(label = "Estatus Social Subjetivo")+
  ylab(label = "Becha salarial justa")+
   labs(title = "Brecha salarial justa según Estatus Social Subjetivo",
       subtitle = "1999",
       caption = "Fuente: Elaboración propia a partir de datos ISSP") +
  theme_classic(base_size = 17) +
      theme(axis.text=element_text(size=10,face = "plain"),
         axis.title.y = element_text(size=10, face="bold"),
         axis.title.x = element_text(size=10, face="bold"),
         plot.title=element_text(hjust=0.5,size = 12,face = "bold"),
         plot.subtitle=element_text(hjust=0.5,size = 10,face = "bold"),
         plot.caption = element_text(hjust=1,size = 10,face = "plain"),
         panel.grid = element_blank(),
         panel.border = element_blank())
plot02a

ggsave(plot02a,filename = "images/ess_lnjust99.png",device = "png",width = 30,height = 15,dpi = "retina",units = "cm")

plot02b <- ggplot(data=subset(clw3,year==2009), aes(ess, y=lngap_just)) +
  geom_point() +
  scale_x_discrete(limits=levels(factor(clw3$ess)),labels=labess) +
  geom_jitter(width = 0.9, height = 0.9) + 
  geom_smooth(method='lm') +
  xlab(label = "Estatus Social Subjetivo")+
  ylab(label = "Becha salarial justa")+
   labs(title = "Brecha salarial justa según Estatus Social Subjetivo",
       subtitle = "2009",
       caption = "Fuente: Elaboración propia a partir de datos ISSP") +
  theme_classic(base_size = 17) +
        theme(axis.text=element_text(size=10,face = "plain"),
         axis.title.y = element_text(size=10, face="bold"),
         axis.title.x = element_text(size=10, face="bold"),
         plot.title=element_text(hjust=0.5,size = 12,face = "bold"),
         plot.subtitle=element_text(hjust=0.5,size = 10,face = "bold"),
         plot.caption = element_text(hjust=1,size = 10,face = "plain"),
         panel.grid = element_blank(),
         panel.border = element_blank())
plot02b

ggsave(plot02b,filename = "images/ess_lnjust09.png",device = "png",width = 30,height = 15,dpi = "retina",units = "cm")

plot02c <- ggplot(data=subset(clw3,year==2019), aes(ess, y=lngap_just)) +
  geom_point() +
  scale_x_discrete(limits=levels(factor(clw3$ess)),labels=labess) +
  geom_jitter(width = 0.9, height = 0.9) + 
  geom_smooth(method='lm') +
  xlab(label = "Estatus Social Subjetivo")+
  ylab(label = "Becha salarial justa")+
   labs(title = "Brecha salarial justa según Estatus Social Subjetivo",
       subtitle = "2019",
       caption = "Fuente: Elaboración propia a partir de datos CEP") +
  theme_classic(base_size = 17) +
      theme(axis.text=element_text(size=10,face = "plain"),
         axis.title.y = element_text(size=10, face="bold"),
         axis.title.x = element_text(size=10, face="bold"),
         plot.title=element_text(hjust=0.5,size = 12,face = "bold"),
         plot.subtitle=element_text(hjust=0.5,size = 10,face = "bold"),
         plot.caption = element_text(hjust=1,size = 10,face = "plain"),
         panel.grid = element_blank(),
         panel.border = element_blank())
plot02c

ggsave(plot02c,filename = "images/ess_lnjust19.png",device = "png",width = 30,height = 15,dpi = "retina",units = "cm")

plot02d <- ggplot(data=clw3, aes(ess, y=lngap_just)) +
  geom_point() +
  scale_x_discrete(limits=levels(factor(clw3$ess)),labels=labess) +
  geom_jitter(width = 0.9, height = 0.9) + 
  geom_smooth(method='lm') +
  xlab(label = "Estatus Social Subjetivo")+
  ylab(label = "Becha salarial justa")+
   labs(title = "Brecha salarial justa según Estatus Social Subjetivo",
       subtitle = "1999 - 2019",
       caption = "Fuente: Elaboración propia a partir de datos CEP-ISSP") +
  theme_classic(base_size = 17) +
      theme(axis.text=element_text(size=10,face = "plain"),
         axis.title.y = element_text(size=10, face="bold"),
         axis.title.x = element_text(size=10, face="bold"),
         plot.title=element_text(hjust=0.5,size = 12,face = "bold"),
         plot.subtitle=element_text(hjust=0.5,size = 10,face = "bold"),
         plot.caption = element_text(hjust=1,size = 10,face = "plain"),
         panel.grid = element_blank(),
         panel.border = element_blank())
plot02d

ggsave(plot02d,filename = "images/ess_lnjust19_19.png",device = "png",width = 30,height = 15,dpi = "retina",units = "cm")